//
//  NSArray+RemoveNUll.m
//  JMDome_1
//
//  Created by ios on 15/6/11.
//  Copyright (c) 2015年 ios. All rights reserved.
//

#import "NSArray+RemoveNUll.h"
#import "NSDictionary+RemoveNUll.h"

@implementation NSArray (RemoveNUll)
+ (instancetype) removeArrayKeyValueWithNull:(NSArray *)array
{
    NSMutableArray *mutalbeArray = [[NSMutableArray alloc]initWithCapacity:0];
    for(int i = 0; i<array.count;i++){
        if([[array objectAtIndex:i] isKindOfClass:[NSDictionary class]]){
            NSDictionary * dict = [NSDictionary removeDictionaryKeyValueWithNull:[array objectAtIndex:i]];
            [mutalbeArray addObject:dict];
        }
    }
    return (NSArray *)mutalbeArray;
}

+ (instancetype) RemoVeArrayObjectWithNull:(NSArray *)array
{
    NSMutableArray *retunArray = [[NSMutableArray alloc]initWithCapacity:0];
    for(NSString * value in array){
        NSString *retunValue = @"";
        if([value isKindOfClass:[NSNull class]] || value == nil ||[value isEqual:[NSNull null]]){
            retunValue = @"";
        }else{
            retunValue = [NSString stringWithFormat:@"%@",value];
        }
        [retunArray addObject:retunValue];
    }
    return (NSArray *)retunArray;
}

+(BOOL)isSureEmpty:(NSArray *)array
{
    
    if (!array || ![array isKindOfClass:[NSArray class]] || !array.count) {
        return YES;
    }
    return NO;
}

@end
